//
//  AboutProductViewController.m
//  FastMedical
//
//  Created by 李通 on 16/7/6.
//  Copyright © 2016年 chivalrous. All rights reserved.
//

#import "AboutProductViewController.h"
#import "SETableFooterView.h"
#import "TableHeaderView.h"

@interface AboutProductViewController ()<UITableViewDelegate,UITableViewDataSource>


@property(nonatomic,strong)UITableView * tableView;

@property(nonatomic,strong)TableHeaderView * headerView;

@property(nonatomic,strong)SETableFooterView * footerView;

@end

@implementation AboutProductViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self setUpTableView];
}

#pragma mark -- 初始化tableView

- (void)setUpTableView{
    
    [self.view addSubview:self.tableView];
    
    self.tableView.tableFooterView = self.footerView;
    self.tableView.tableHeaderView = self.headerView;
}

#pragma mark -- 代理方法
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    
    [SVProgressHUD showSuccessWithStatus:@"打开协议"];
    [SVProgressHUD setFadeOutAnimationDuration:0.5];
    [SVProgressHUD setFadeInAnimationDuration:0];
    
    [SVProgressHUD setDefaultMaskType:SVProgressHUDMaskTypeCustom];
    
    
    [SVProgressHUD performSelector:@selector(dismiss) withObject:nil afterDelay:1];
    
}


- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    
    return 1;
    
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    UITableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:@"cell"];
    if (cell == nil) {
        
        cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell"];
        
    }
    
    cell.imageView.image = [UIImage imageNamed:@"product_img_icon_xieyi.png"];
    cell.textLabel.text = @"用户协议";
    cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    cell.textLabel.font = [UIFont systemFontOfSize:15];
    
    
    return cell;
    
}

#pragma mark -- lazy
- (UITableView *)tableView{
    
    if (_tableView == nil) {
        
        _tableView = [[UITableView alloc]initWithFrame:self.view.frame style:UITableViewStylePlain];
        
        
        _tableView.delegate = self;
        _tableView.dataSource = self;
        
    }
    
    return _tableView;
}

- (UIView *)headerView{
    
    if (_headerView == nil) {
        
        
        _headerView = [[TableHeaderView alloc]initWithFrame:CGRectMake(0, 0, 375, 200)];
        
        
    }
    return _headerView;
    
}

- (UIView *)footerView{
    
    if (_footerView == nil) {
        
        _footerView = [[SETableFooterView alloc]initWithFrame:CGRectMake(0, 0, 375, 400)];
        
    }
    
    return _footerView;
    
}




@end